package com.byx.chatclient.model;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;

/**
 * ChatPo
 *
 * @author Superb
 * @date 2021/2/5 15:55
 */
@Entity
public class ChatPo {
    @Id
    private String senderId;
    private String avatar;
    private String nickName;
    private String simpleMessage;
    private String sendTime;
    private int unreadCount;
    private boolean isSingleChat;
    @Generated(hash = 767589272)
    public ChatPo(String senderId, String avatar, String nickName,
            String simpleMessage, String sendTime, int unreadCount,
            boolean isSingleChat) {
        this.senderId = senderId;
        this.avatar = avatar;
        this.nickName = nickName;
        this.simpleMessage = simpleMessage;
        this.sendTime = sendTime;
        this.unreadCount = unreadCount;
        this.isSingleChat = isSingleChat;
    }
    @Generated(hash = 1612961392)
    public ChatPo() {
    }
    public String getSenderId() {
        return this.senderId;
    }
    public void setSenderId(String senderId) {
        this.senderId = senderId;
    }
    public String getAvatar() {
        return this.avatar;
    }
    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }
    public String getNickName() {
        return this.nickName;
    }
    public void setNickName(String nickName) {
        this.nickName = nickName;
    }
    public String getSimpleMessage() {
        return this.simpleMessage;
    }
    public void setSimpleMessage(String simpleMessage) {
        this.simpleMessage = simpleMessage;
    }
    public String getSendTime() {
        return this.sendTime;
    }
    public void setSendTime(String sendTime) {
        this.sendTime = sendTime;
    }
    public int getUnreadCount() {
        return this.unreadCount;
    }
    public void setUnreadCount(int unreadCount) {
        this.unreadCount = unreadCount;
    }
    public boolean getIsSingleChat() {
        return this.isSingleChat;
    }
    public void setIsSingleChat(boolean isSingleChat) {
        this.isSingleChat = isSingleChat;
    }

    public void increaseMessageCount(){
        this.unreadCount ++;
    }

    public void resetMessageCount(){
        this.unreadCount = 0;
    }
}
